package biz;

import dao.CustomertbDAO;
import entity.CustomertbEntity;

import java.sql.SQLException;
import java.util.List;

/*
 * @Description锛�
 *       瀹㈡埛琛ㄤ笟鍔″鐞�
 * @Author: JiangFan
 * @Date: 2019/3/8
 * @Time锛�16:10
 */
public class CustomerBiz {
	
CustomertbDAO cust=new CustomertbDAO();
	
	public List<CustomertbEntity> login(String userid) {
		
		return cust.selectCustomertb(userid);
		
	}
	public List<CustomertbEntity> login_id(String userid) {
		
		return cust.selectcustomer_xiaomi_id(userid);
		
	}
	public List<CustomertbEntity> login_email(String userid) {
		
		return cust.selectCustomertb_email(userid);
		
	}
	public int update(String userid) {
		
			try {
				return cust.adduserid(userid);
			} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return 0;

	}
	public int user_registered(String userid,String username,String userpassword,String usermail) {
		try {
			return cust.adduser(userid, username, userpassword, usermail);
		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return 0;
		
	}

}
